Imports [lib].myDBconn2
Imports System.Data.OracleClient

Namespace persistent


    Public Class Alt_fatura

        Public Shared Function alt_fatura_paketi(ByVal custcode As String, ByVal type_id As Char) As String

            Dim command As New OracleCommand("EU_BILL.ALT_FTR_CUSTCODE_PROCESS")

            command.Parameters.Add("Pin_custcode", OracleType.VarChar, 15).Value = custcode
            command.Parameters.Add("pin_type", OracleType.VarChar, 2).Value = type_id

            command.Parameters.Add("po_result", OracleType.VarChar, 200).Direction = ParameterDirection.Output


            persistent.DataEngine.ExecuteNonQuery(command)

            Dim log_query As String = "select * from dual"
            Dim gen As Object = New AltFatura()
            persistent.myDBConn.ORAScalar_LOG(log_query, custcode, "", "", "", "Select(alt_fatura_paketi)", "AltFatura", gen.Session("user"))
            Dim result As String
            result = CheckDBNull(command.Parameters("po_result").Value)
            Return result


        End Function

        Private Shared Function CheckDBNull(ByVal inputValue As Object) As String
            If IsDBNull(inputValue) Then
                Return String.Empty
            Else
                Return CStr(inputValue)
            End If
        End Function
    End Class
End Namespace